﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

/// <summary>
/// 角色管理
/// </summary>
public class RoleManager : Singleton<RoleManager>
{
    [System.NonSerialized]
    public PlayerHP localPlayer;
    [System.NonSerialized]
    public List<EnemyHP> enemys = new List<EnemyHP>();

    public void AddPlayer(PlayerHP player)
    {
        localPlayer = player;
    }
    public void AddEnemy(EnemyHP enemy)
    {
        enemys.Add(enemy);
    }
    public void RemoveEnemy(EnemyHP enemy)
    {
        enemys.Remove(enemy);
    }
    public EnemyHP GetOneEnemy()
    {
        int index = Random.Range(0, enemys.Count);
        return enemys[index];
    }
}
